<!DOCTYPE html>
<html lang="en">
<head>
    <title>大区意向客户列表</title>
    <meta http-equiv="pragma" content="no-cache">
    <meta http-equiv="Cache-Control" content="no-store, must-revalidate">
    <meta http-equiv="expires" content="Wed, 26 Feb 1997 08:21:57 GMT">
    <meta http-equiv="expires" content="-1">
    <meta content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no"
          name="viewport">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <link rel="shortcut icon" href="/dist/img/icon.png" type="image/x-icon">
    <!--字体-->
    <link rel="stylesheet" href="/dist/css/font-awesome.min.css">
    <script src="https://file.ggxqce.com/web/vue.min.js"></script>
    <link rel="stylesheet" href="/dist/css/oa-app.css">

</head>
<style>
    [v-cloak] {
        display: none;
    }

    * {
        -webkit-box-sizing: border-box;
        -moz-box-sizing: border-box;
        box-sizing: border-box;
        font-size: 12px;
    }

    body {
        background: #fff;
    }

    .boxBoy {
        background: #fff;
    }

    table {
        border-spacing: 0;
        border-collapse: collapse;
        display: table;
    }

    .weather {
        text-align: center;
        font-size: 16px;
        position: absolute;
        top: 5px;
        line-height: 30px;
        float: left;
    }

    th {
        font-weight: normal;
    }

    table.text-center, table.text-center td, table.text-center th {
        text-align: center;
        font-size: 12px;
    }

    .table-bordered > thead > tr > th, .table-bordered > tbody > tr > th, .table-bordered > tfoot > tr > th, .table-bordered > thead > tr > td, .table-bordered > tbody > tr > td, .table-bordered > tfoot > tr > td {
        border: 1px solid #cbcbcd;
        height: 28px;
        /*position: relative;*/
        padding: 0 4px;
    }

    table th {
        background: #f8f8f8;
    }

    .table-bordered {
        border: 1px solid #cbcbcd;
        border-top-width: 0px !important;
    }

    .table {
        width: 100%;
        max-width: 100%;
    }

    .hidden {
        display: none;
    }

    .lineOne, .lineTwo {
        text-align: left;
    }

    .tdColor {
        border-top: 0px !important;
        background-color: #f8f8f8;
        font-weight: normal;
        color: #333 !important;
    }

    .lineOne span {
        max-height: 24px;
        line-height: 24px;
        overflow: hidden;
        text-overflow: ellipsis;
        display: -webkit-box;
        -webkit-box-orient: vertical;
        -webkit-line-clamp: 1;
        text-align: left;
    }

    .lineTwo span {
        max-height: 55px;
        line-height: 16px;
        overflow: hidden;
        text-overflow: ellipsis;
        display: -webkit-box;
        -webkit-box-orient: vertical;
        -webkit-line-clamp: 3;
        text-align: left;
        padding: 5px;

    }

    .div-td-content-more {
        position: absolute;
        height: auto;
        z-index: 999;
        line-height: 20px;
        background-color: #d3e8fd;
        padding: 8px 6px;
        border: 1px solid #e8e8ea;
        display: none;
    }

    .div-td-content-more i {
        width: 15px;
        height: 12px;
        background: url("/dist/img/more-icon.png");
        position: absolute;
        left: 50px;
        top: -12px;
    }

    .clear {
        clear: both
    }

    .boxItem {
        width: 100%;
        margin-top: -1px;
        padding-bottom: 0;
        background: inherit;
        background-color: rgba(255, 255, 255, 1);
        border: none;
        position: relative;
    }

    .boxItemTitle {
        color: #2c8cec;
        font-size: 16px;
        font-weight: bold;
        margin-bottom: 6px;
        text-align: center;
    }

    .home {
        font-size: 14px;
        font-weight: bold;
        margin-bottom: 10px;
        height: 14px;
        line-height: 14px;
        text-align: center;
    }

    .dian-icon {
        background: url("/dist/img/dian.png") no-repeat;
        background-size: cover;
        width: 14px;
        height: 14px;
        display: inline-block;
    }

    .jiaobiao, .jiaobiaoNew {
        position: relative;
    }

    .jiaobiao i {
        display: block;
        width: 0;
        height: 0;
        border-width: 0px 0 12px 12px;
        border-style: solid;
        border-color: transparent transparent transparent #2a8cec;
        position: absolute;
        top: 0px;
        left: 0px;
    }

    .jiaobiaoNew i {
        display: block;
        width: 12px;
        height: 12px;
        background: url("/dist/img/newLog2.png");
        background-size: 100% 100%;
        position: absolute;
        top: 0px;
        left: 0px;
    }

    .lineImg {
        padding-top: 5px !important;
        padding-bottom: 10px !important;
    }

    .lineImg img {
        height: 45px;
        width: 45px;
        float: left;
        margin: 10px;
        object-fit: cover;
    }

    .newCustomer {
        background: url(/dist/img/new.png) no-repeat;
        background-size: cover;
        width: 20px;
        height: 20px;
        right: 0;
        top: 2px;
        position: absolute;
    }

    .wajueji {
        padding-left: 140px;
        background: url("/dist/img/wajueji.png") no-repeat;
        background-size: 120px 88px;
        height: 88px;
        line-height: 88px;
        color: red;
        font-size: 14px;
        font-weight: bold;
        margin-left: 50px;
    }

    .qipao {
        /*background: url(/dist/img/qipao.png);*/
        background-size: 100% 100%;
        height: 88px;
        /* padding: 0 20px; */
        padding-left: 20px;
        /*padding-right: 20px;*/
        color: red;
        line-height: 88px;
        float: left;
        font-size: 14px;
        font-weight: bold;
    }

    .plan1 {
        background: url("/dist/img/plan1.png") no-repeat center center;
        background-size: 100%;
    }

    .plan2 {
        background: url("/dist/img/plan2.png") no-repeat center center;
        background-size: 100%;
    }

    .plan3 {
        background: url("/dist/img/plan3.png") no-repeat center center;
        background-size: 100%;
    }

    .boxItemTitleNotice {
        color: red;
        font-size: 16px;
        font-weight: bold;
        margin-bottom: 10px;
        text-align: center;
    }

    .boxItemTitleNotice i {
        background: url("/dist/img/jg.png") no-repeat center center;
        height: 16px;
        width: 16px;
        background-size: cover;
        display: inline-block;
        margin-bottom: -3px;
        margin-left: 5px;
    }

    .boxItemTitleNoticeTime {
        color: red;
        font-size: 20px;
        font-weight: bold;
        margin-bottom: 10px;
        text-align: center;
    }

    .boxItemTitleNoticeTime i {
        background: url("/dist/img/jg.png") no-repeat center center;
        height: 16px;
        width: 16px;
        background-size: cover;
        display: inline-block;
        margin-bottom: -3px;
        margin-left: 5px;
    }

    .search-button {
        width: 14px;
        height: 14px;
        background-image: url(/dist/img/glass.jpg);
        border: 0 none;
        cursor: pointer;
        margin-top: 0px;
    }

    input[type=button] {
        outline: none;
    }

    .oaBtn {
        background: url(/dist/img/btn-bj2.png) repeat-y !important;
        background-size: 100% 100% !important;
        color: #fff !important;
    }

    .btn-group-sm > .btn, .btn-sm {
        padding: 2px 10px;
    }

    .btn {
        border-radius: 3px;
        -webkit-box-shadow: none;
        box-shadow: none;
        border: 1px solid transparent;
    }

    .pull-right {
        float: right !important;
    }

    .blue {
        color: #39c;
    }

    .red {
        color: #e03800;
    }

    .weather img {
        height: 30px;
        width: 30px;
        float: left;
    }

    .btn-blue {
        border: none;
        background: #2a8cec;
        color: #fff;
        font-size: 16px;
        height: 48px;
        width: 100%;
        border-radius: 2px;
        outline: none;
        position: fixed;
        left: 0;
        bottom: 0;
        font-weight: bold;
    }

    .btn-blue:active {
        border: none;
        background: #356698;
        opacity: 0.8;
        color: #fff;
        font-size: 16px;
        height: 48px;
        width: 100%;
        border-radius: 2px;
        outline: none;
        position: fixed;
        left: 0;
        bottom: 0;
        font-weight: bold;
    }

    .btn-blue.focus, .btn-blue:focus, .btn-blue:hover {
        color: #fff;
        text-decoration: none;

    }

    .line {
        border-bottom: 4px solid #2a8cec;
    }

    .templateStyle {
        width: 100%;
        /* margin-top: 15px;
         margin-left: 10px;
         margin-right: 10px;*/
        /*box-shadow: 2px 2px 3px #DDDDDD;*/
    }

    .td-module {
        background: #d3e8fd !important;
        color: black !important;
    }
</style>
<body>
<section class="content" id="app" v-cloak style="padding: 0;min-height: 100vh">
    <div class="div-td-content-more"><i></i></div>
    <!--销售目标-->
    <div class="templateStyle">
        <table class="table table-bordered text-center table-width" style="border: 0px;">
            <tbody>
            <tr>
                <td class="td-module"><!--{{user.departName}}-->
                    2019年销售目标
                </td>
            </tr>
            </tbody>
        </table>
        <table class="table table-bordered text-center table-width" style="border: 0px;">
            <tbody>
            <tr>
                <td class="tdColor" style="width: 20%;">姓名</td>
                <td class="tdColor" style="width: 20%;">年度目标</td>
                <td class="tdColor" style="width: 10%;">完成</td>
                <td class="tdColor" style="width: 20%;">本月目标</td>
                <td class="tdColor" style="width: 10%;">完成</td>
                <td class="tdColor" style="width: 20%;">完成概率</td>
            </tr>
            <tr>
                <td>
                    {{user.name}}
                </td>
                <td>{{bigData.targetNum}}</td>
                <td>{{bigData.finishNum}}</td>
                <td>{{bigData.monthTargetNum}}</td>
                <td>{{bigData.monthFinishNum}}</td>
                <td>{{bigData.finishNum?Math.round(bigData.finishNum/ bigData.targetNum * 10000) /
                    100.00+"%":"0%"}}
                </td>
            </tr>
            <tr v-for="(item,i) in listTarget">
                <td>
                    <div class="oa-name">{{item.regionManagerName}}</div>
                </td>
                <td>{{item.targetNum}}</td>
                <td>{{item.finishSum}}</td>
                <td>{{getMonthData(item,'target')}}</td>
                <td>{{getMonthData(item,'finish')}}</td>
                <td>{{item.finishSum?Math.round(item.finishSum/ item.targetNum * 10000) /
                    100.00+"%":"0%"}}
                </td>
            </tr>
            </tbody>

        </table>
    </div>
    <!--本月内-->
    <div class="templateStyle" style="margin-top: 10px;">
        <div class="boxItem">
            <div class="boxBoy">
                <table class="table table-bordered text-center table-width" style="border: 0px;">
                    <tbody>
                    <tr>
                        <td class="td-module">本月内</td>
                    </tr>
                    </tbody>
                </table>
                <table class="table table-bordered text-center table-width"
                       style="table-layout: fixed;border: 0px">
                    <tbody>
                    <tr>
                        <td class="tdColor" style="width: 20%;">区域经理</td>
                        <td class="tdColor" style="width: 20%;">客户</td>
                        <td class="tdColor" style="width: 20%;">品牌</td>
                        <td class="tdColor" style="width: 20%;">机型</td>
                        <td class="tdColor" style="width: 20%;">成交概率</td>
                    </tr>
                    <tr v-for="(item,i) in list1">
                        <td :rowspan="item.genZRspan" :class="{hidden:item.genZRdis}">
                            <div class="oa-name">{{item.genZR}}</div>
                        </td>
                        <td style="color: #2a8cec;overflow:hidden;text-overflow:ellipsis;"
                            @click="openDetail(item.customerId,0,'look')"
                            v-if="item.customerName">
                            <div class="oa-name">{{item.customerName}}</div>
                        </td>
                        <td v-else></td>
                        <td>{{item.intentionBrand}}</td>
                        <td class="lineOne"><span>{{item.intentionModel}}</span></td>
                        <td>{{item.chance}}</td>
                    </tr>
                    </tbody>
                </table>
                <div v-if="returnFlag" :class="!list1 ||list1.length<=0?'table-bordered':''">
                    <div style="margin: 0 auto;color: #999999;text-align: center;padding: 32px;font-size: 16px;background: #fff;"
                         v-if="!list1 ||list1.length<=0">
                        暂无意向客户
                    </div>
                </div>
            </div>
            <div class="clear"></div>
        </div>
    </div>
    <!--下月内-->
    <div class="templateStyle" style="margin-top: 10px;">
        <div class="boxItem">
            <div class="boxBoy">
                <table class="table table-bordered text-center table-width">
                    <tbody>
                    <tr>
                        <td class="td-module">下月内</td>
                    </tr>
                    </tbody>
                </table>
                <table class="table table-bordered text-center table-width"
                       style="table-layout: fixed;">
                    <tbody>
                    <tr>
                        <td class="tdColor" style="width: 20%;">区域经理</td>
                        <td class="tdColor" style="width: 20%;">客户</td>
                        <td class="tdColor" style="width: 20%;">品牌</td>
                        <td class="tdColor" style="width: 20%;">机型</td>
                        <td class="tdColor" style="width: 20%;">成交概率</td>
                    </tr>
                    <tr v-for="(item,i) in list2">
                        <td :rowspan="item.genZRspan" :class="{hidden:item.genZRdis}">
                            <div class="oa-name">{{item.genZR}}</div>
                        </td>
                        <td style="color: #2a8cec;overflow:hidden;text-overflow:ellipsis;"
                            @click="openDetail(item.customerId,0,'look')"
                            v-if="item.customerName">
                            <div class="oa-name">{{item.customerName}}</div>
                        </td>
                        <td v-else></td>
                        <td>{{item.intentionBrand}}</td>
                        <td class="lineOne"><span>{{item.intentionModel}}</span></td>
                        <td>{{item.chance}}</td>
                    </tr>
                    </tbody>
                </table>
                <div v-if="returnFlag" :class="!list2 ||list2.length<=0?'table-bordered':''">
                    <div style="margin: 0 auto;color: #999999;text-align: center;padding: 32px;font-size: 16px;background: #fff;"
                         v-if="!list2 ||list2.length<=0">
                        暂无意向客户
                    </div>
                </div>
            </div>
            <div class="clear"></div>
        </div>
    </div>
    <!--三月内-->
    <div class="templateStyle" style="margin-top: 10px;">
        <div class="boxItem">
            <div class="boxBoy">
                <table class="table table-bordered text-center table-width">
                    <tbody>
                    <tr>
                        <td class="td-module">三月内</td>
                    </tr>
                    </tbody>
                </table>
                <table class="table table-bordered text-center table-width"
                       style="table-layout: fixed;">
                    <tbody>
                    <tr>
                        <td class="tdColor" style="width: 20%;">区域经理</td>
                        <td class="tdColor" style="width: 20%;">客户</td>
                        <td class="tdColor" style="width: 20%;">品牌</td>
                        <td class="tdColor" style="width: 20%;">机型</td>
                        <td class="tdColor" style="width: 20%;">成交概率</td>
                    </tr>
                    <tr v-for="(item,i) in list3">
                        <td :rowspan="item.genZRspan" :class="{hidden:item.genZRdis}">
                            <div class="oa-name">{{item.genZR}}</div>
                        </td>
                        <td style="color: #2a8cec;overflow:hidden;text-overflow:ellipsis;"
                            @click="openDetail(item.customerId,0,'look')"
                            v-if="item.customerName">
                            <div class="oa-name">{{item.customerName}}</div>
                        </td>
                        <td v-else></td>
                        <td>{{item.intentionBrand}}</td>
                        <td class="lineOne"><span>{{item.intentionModel}}</span></td>
                        <td>{{item.chance}}</td>
                    </tr>
                    </tbody>
                </table>
                <div v-if="returnFlag" :class="!list3 ||list3.length<=0?'table-bordered':''">
                    <div style="margin: 0 auto;color: #999999;text-align: center;padding: 32px;font-size: 16px;background: #fff;"
                         v-if="!list3 ||list3.length<=0">
                        暂无意向客户
                    </div>
                </div>
            </div>
            <div class="clear"></div>
        </div>
    </div>
    <!--半年内-->
    <div class="templateStyle" style="margin-top: 10px;">
        <div class="boxItem">
            <div class="boxBoy">
                <table class="table table-bordered text-center table-width">
                    <tbody>
                    <tr>
                        <td class="td-module">半年内</td>
                    </tr>
                    </tbody>
                </table>
                <table class="table table-bordered text-center table-width"
                       style="table-layout: fixed;">
                    <tbody>
                    <tr>
                        <td class="tdColor" style="width: 20%;">区域经理</td>
                        <td class="tdColor" style="width: 20%;">客户</td>
                        <td class="tdColor" style="width: 20%;">品牌</td>
                        <td class="tdColor" style="width: 20%;">机型</td>
                        <td class="tdColor" style="width: 20%;">成交概率</td>
                    </tr>
                    <tr v-for="(item,i) in list4">
                        <td :rowspan="item.genZRspan" :class="{hidden:item.genZRdis}">
                            <div class="oa-name">{{item.genZR}}</div>
                        </td>
                        <td style="color: #2a8cec;overflow:hidden;text-overflow:ellipsis;"
                            @click="openDetail(item.customerId,0,'look')"
                            v-if="item.customerName">
                            <div class="oa-name">{{item.customerName}}</div>
                        </td>
                        <td v-else></td>
                        <td>{{item.intentionBrand}}</td>
                        <td class="lineOne"><span>{{item.intentionModel}}</span></td>
                        <td>{{item.chance}}</td>
                    </tr>
                    </tbody>
                </table>
                <div v-if="returnFlag" :class="!list4 ||list4.length<=0?'table-bordered':''">
                    <div style="margin: 0 auto;color: #999999;text-align: center;padding: 32px;font-size: 16px;background: #fff;"
                         v-if="!list4 ||list4.length<=0">
                        暂无意向客户
                    </div>
                </div>
            </div>
            <div class="clear"></div>
        </div>
    </div>
    <!--已成交-->
    <!--<div class="templateStyle" style="margin-top: 10px;">-->
    <!--<div class="boxItem">-->
    <!--<div class="boxBoy">-->
    <!--<table class="table table-bordered text-center table-width">-->
    <!--<tbody>-->
    <!--<tr>-->
    <!--<td style="background-color: #2c8cec;color: white">已成交</td>-->
    <!--</tr>-->
    <!--</tbody>-->
    <!--</table>-->
    <!--<table class="table table-bordered text-center table-width">-->
    <!--<tbody>-->
    <!--<tr>-->
    <!--<td class="tdColor" style="width: 20%;">客户</td>-->
    <!--<td class="tdColor" style="width: 20%;">区域经理</td>-->
    <!--<td class="tdColor" style="width: 20%;">品牌</td>-->
    <!--<td class="tdColor" style="width: 20%;">机型</td>-->
    <!--<td class="tdColor" style="width: 20%;">成交概率</td>-->
    <!--</tr>-->
    <!--<tr v-for="(item,i) in listDone">-->
    <!--<td style="color: #2a8cec;" @click="openDetail(item.customerId,0,'look')" class="lineOne">-->
    <!--<span style="text-align: center">{{item.customerName}}</span>-->
    <!--</td>-->
    <!--<td>{{item.createUserName}}</td>-->
    <!--<td>{{item.intentionBrand}}</td>-->
    <!--<td style="text-align: left;">{{item.intentionModel}}</td>-->
    <!--<td>{{item.chance}}</td>-->
    <!--</tr>-->
    <!--</tbody>-->
    <!--</table>-->
    <!--<div v-if="returnFlag" class="table-bordered">-->
    <!--<div style="margin: 0 auto;color: #999999;text-align: center;padding: 32px;font-size: 16px;background: #fff;"-->
    <!--v-if="!listDone ||listDone.length<=0">-->
    <!--暂无已成交-->
    <!--</div>-->
    <!--</div>-->
    <!--</div>-->
    <!--<div class="clear"></div>-->
    <!--</div>-->
    <!--</div>-->
    <div style="height: 58px;"></div>
    <button type="button" class="btn btn-blue" style="border-top: 1px solid white"
            @click="openDetail('',1,'edit')">新增意向客户
    </button>
</section>
<!--JQ-->
<script src="https://file.ggxqce.com/web/jquery-2.2.3.min.js"></script>
<!--插件JS-->
<script src="/dist/plugins/scroll/myScroll.js"></script>
<!--框架已定义 JS-->
<!--oa自定义  JS-->
<script src="/dist/js/oaApp.js"></script>

<script type="text/javascript" src="/dist/plugins/lhgdialog/lhgdialog.min.js?self=true"></script>
<script>
    $(function () {
        $("body").on("click", ".lineOne,.lineTwo", function (e) {
            if ($(".div-td-content-more").is(":hidden")) {
                var text = $(this).text();
                if (text != "") {
                    text = "<i></i>" + text;
                    $(".div-td-content-more").html(text).css({
                        "width": $(this).outerWidth() + "px",
                        "left": $(this).offset().left,
                        "top": ($(this).offset().top + $(this).outerHeight()) + "px"
                    }).show();
                    e.stopPropagation();
                }
            } else {
                $(".div-td-content-more").hide();
            }
        });
        $("body").on("click", ".div-td-content-more", function (e) {
            e.stopPropagation();
        });
        $("body").on("click", function () {
            $(".div-td-content-more").hide();
        });
    });
</script>
<script>
    $.ajaxSetup({
        global: true,
        type: "POST",
        cache: false,
        dataType: "json",
        contentType: 'application/json;charset=utf-8',
        beforeSend: function () {
        },
        complete: function () {

        },
        error: function (e) {
            alert('error' + e.responseText);
        }
    });
    $.extend($.wyui, {
        postMethod: function (url, data, callback, sync, id) {
            if (!id) {
                id = "#app"
            }
            $.ajax({
                url: server.ip + url,
                async: sync ? false : true,
                data: JSON.stringify(data),
                beforeSend: function () {

                },
                complete: function () {
                    setTimeout(function () {
                    }, 1000);

                },
                success: function (r) {
                    if (!r.e.code) {
                        callback(r.data.sendData);
                    } else {
                        alert(r.e.desc);
                    }
                },
                error: function (e) {
                    alert(url + e.responseText);
                }
            });
        },
    });
</script>
<script type="text/javascript">
    var app = new Vue({
        el: "#app",
        data: {
            userId: getUrlParamObj().userId,
            userName: getUrlParamObj().userName,
            companyId: getUrlParamObj().companyId,
            dateTime: "2019",
            currentMonth: new Date().Format("M"),
            key: '',
            buyDateList: "'','七天内','一月内'",
            customerList: [],
            returnFlag: false,
            listMonth: [],
            daQuObj: {},
            listYear: [],
            listTarget: [],
            list1: [],
            list2: [],
            list3: [],
            list4: [],
            listLost: [],
            listDone: [],
            isSelf: getUrlParamObj().isSelf,
            beginMonth: '',
            middleMonth: '',
            endMonth: '',
            user: {},
            bigData: {
                "targetNum": "",
                "finishNum": "",
                "monthTargetNum": "",
                "monthFinishNum": "",
                "gl": ""
            }
        },
        methods: {
            //获取合计
            getCount: function (arr, key) {
                var number = 0;
                for (var i = arr.length - 1; i >= 0; i--) {
                    number += (arr[i][key] && arr[i][key] != '-' ? arr[i][key] : 0)

                }
                return number;
            },
            // 电话号码中间用*代替
            telNumber: function (telNum) {
                var firstTelNum = telNum.substring(0, 3);
                var lastTelNum = telNum.substring(telNum.length - 4, telNum.length);
                return firstTelNum + "****" + lastTelNum;
            },
            getMonthData: function (item, type) {
                var str = '';
                switch (this.currentMonth) {
                    case "1":
                        //alert(report.dateReissueEnd)
                        str = 'jan'
                        break;
                    case "2":
                        str = 'feb'
                        break;
                    case "3":
                        str = 'mar'
                        break;
                    case "4":
                        str = 'apr'
                        break;
                    case "5":
                        str = 'may'
                        break;
                    case "6":
                        str = 'june'
                        break;
                    case "7":
                        str = 'july'
                        break;
                    case "8":
                        str = 'aug'
                        break;
                    case "9":
                        str = 'sept'
                        break;
                    case "10":
                        str = 'oct'
                        break;
                    case "11":
                        str = 'nov'
                        break;
                    case "12":
                        str = 'dece'
                        break;
                    default:
                        break;
                }
                if (type == 'finish') {
                    str += "Finish"
                }
                console.log(str);
                console.log(item[str]);
                return item[str];
            },
            getById: function () {
                var that = this;
                $.wyui.postMethod(urlConfig.system.user.getUserViewById, {
                    "id": that.userId
                }, function (data) {
                    console.log(data)
                    that.user = data;
                    if (!that.companyId) {
                        that.companyId = that.user.companyId
                    }
                    console.log('companyId=' + that.companyId)
                })
            },
            //合并单元格
            tablesMergeCell: function (list) {
                for (field in list[0]) {
                    var k = 0;
                    while (k < list.length) {
                        list[k][field + 'span'] = 1;
                        list[k][field + 'dis'] = false;
                        for (var i = k + 1; i <= list.length - 1; i++) {
                            if (list[k][field] == list[i][field] && list[k][field] != '') {
                                list[k][field + 'span']++;
                                list[k][field + 'dis'] = false;
                                list[i][field + 'span'] = 1;
                                list[i][field + 'dis'] = true;
                            } else {
                                break;
                            }
                        }
                        k = i;
                    }
                }
                return list;
            },
            //本月目标、本年目标
            getTarget: function () {
                var that = this;
                $.wyui.postMethod('/depConfig/getRegionSaleTarget.json', {
                    "userId": that.userId,
                    "companyId": that.companyId,
                    "dateTime": that.dateTime
                }, function (data) {
                    console.log(data)
                    that.listTarget = data.info;
                    that.bigData.targetNum = that.getCount(data.info, 'targetNum')
                    that.bigData.finishNum = that.getCount(data.info, 'finishNum')
                    var str = '';
                    switch (that.currentMonth) {
                        case "1":
                            //alert(report.dateReissueEnd)
                            str = 'jan'
                            break;
                        case "2":
                            str = 'feb'
                            break;
                        case "3":
                            str = 'mar'
                            break;
                        case "4":
                            str = 'apr'
                            break;
                        case "5":
                            str = 'may'
                            break;
                        case "6":
                            str = 'june'
                            break;
                        case "7":
                            str = 'july'
                            break;
                        case "8":
                            str = 'aug'
                            break;
                        case "9":
                            str = 'sept'
                            break;
                        case "10":
                            str = 'oct'
                            break;
                        case "11":
                            str = 'nov'
                            break;
                        case "12":
                            str = 'dece'
                            break;
                        default:
                            break;
                    }
                    that.bigData.monthTargetNum = that.getCount(data.info, str)
                    that.bigData.monthFinishNum = that.getCount(data.info, str + "Finish")
                })
            },
            //获取七天内等
            get_customerList_regionManager: function () {
                var that = this;
                var obj = {
                    dialog: 'show'
                }
                prompt(JSON.stringify(obj))
                $.wyui.postMethod(urlConfig.intentionCustomerManagement.getIntentCustomerListForBigRegion, {
                    "userId": that.userId,
                    "buyDate": that.buyDate,
                    "key": that.key
                }, function (data) {
                    console.log(data.records)
                    for (var i = 0; i < data.records.length; i++) {
                        var item = data.records[i]
                        if (item && item.customerTel) {
                            item.customerTel = item.customerTel.replace(/\s+/g, "");
                            if (that.isSelf != '1') {
                                item.customerTel = that.telNumber(item.customerTel);
                            }
                        }
                        if (item.createUserId) {
                            that.currentCreateUserId = item.createUserId
                        }
                        switch (item.buyDate) {
                            case '本月内':
                                that.list1.push(item)
                                break
                            case '下月内':
                                that.list2.push(item)
                                break
                            case '三月内':
                                that.list3.push(item)
                                break
                            case '已成交':
                                that.listDone.push(item)
                                break
//                            case '丢单':
//                                that.listLost.push(item)
//                                break
                            case '半年内':
                                that.list4.push(item)
                                break
                        }
                    }
                    that.tablesMergeCell(that.list1);
                    that.tablesMergeCell(that.list2);
                    that.tablesMergeCell(that.list3);
                    that.tablesMergeCell(that.list4);
                    that.tablesMergeCell(that.listDone);
                    if (that.list1.length > 0 && that.list1.length < 3) {
                        for (var i = 0; i <= 3 - that.list1.length; i++) {
                            that.list1.push({})
                        }
                    }
                    if (that.list2.length > 0 && that.list2.length < 3) {
                        for (var i = 0; i <= 3 - that.list2.length; i++) {
                            that.list2.push({})
                        }
                    }
                    if (that.list3.length > 0 && that.list3.length < 3) {
                        for (var i = 0; i <= 3 - that.list3.length; i++) {
                            that.list3.push({})
                        }
                    }
                    if (that.list4.length > 0 && that.list4.length < 3) {
                        for (var i = 0; i <= 3 - that.list4.length; i++) {
                            that.list4.push({})
                        }
                    }
                    // that.customerList = data.records;
                    //不足3个补充
                    that.fill3Empty(that.list1)
                    that.fill3Empty(that.list2)
                    that.fill3Empty(that.list3)
                    that.fill3Empty(that.list4)
                    that.fill3Empty(that.listDone)
//                    that.fill3Empty(that.listLost)
                    var obj = {
                        dialog: 'hidden'
                    }
                    prompt(JSON.stringify(obj))
                    that.returnFlag = true;
                });
            },
            //打开客户详情
            openDetail: function (customerId, isAdd, pageType) {
                var isRegion = ''
                if (this.isSelf == 1) {
                    pageType = "edit"
                    isRegion = 1
                }
                var that = this;
                var obj = {
                    type: 'goDetail',
                    url: '/intentionManagement/quYuIntentionalDetailApp.html?customerId=' + customerId + '&isAdd=' + isAdd + '&pageType=' + pageType + '&userId=' + that.userId + '&companyId=' + that.companyId + '&isRegion=' + isRegion + '&isSelf=' + that.isSelf,
                    name: '意向客户详情',
                    enableRefresh: false
                }
                prompt(JSON.stringify(obj))
            },
            fill3Empty: function (list) {
                if (list && list.length > 0 && list.length < 3) {
                    for (var i = 0; i <= 3 - list.length; i++) {
                        list.push({})
                    }
                }
            },
            //获取合计
            getCount: function (arr, key) {
                var number = 0;
                for (var i = arr.length - 1; i >= 0; i--) {
                    number += (arr[i][key] && arr[i][key] != '-' ? arr[i][key] : 0)

                }
                return number;
            },
        },
        mounted: function () {
            var that = this;
            that.getById();
            that.getTarget();
            that.get_customerList_regionManager();
        }


    })
</script>
</body>
</html>